﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;

namespace CI.PW
{
    /// <summary>
    /// Interaction logic for NewService.xaml
    /// </summary>
    public partial class NewService : Page
    {
        NavigationService _navService;
        /// <summary>
        /// new scenario
        /// </summary>
        public NewService()
        {
            InitializeComponent();
        }

        private void ConnectRobot(object sender, RoutedEventArgs e)
        {
            // go to page
            if (_navService == null)
                _navService = NavigationService.GetNavigationService(this);

            SimEnv.Instance.UsingHW = true;
            Globals.BreakTime = new TimeSpan(0, 5, 0);
            Display.Bootstrap.ContractName = Globals.IRobotControllerContract;
            Display.Bootstrap.ManifestName = "iRobotController.manifest.xml";

            var simulationOptions = new SimulationOption();
            _navService.Navigate(simulationOptions);
        }

        private void SimulatedRobotLearning(object sender, RoutedEventArgs e)
        {
            // go to page
            if (_navService == null)
                _navService = NavigationService.GetNavigationService(this);

            var simulationOptions = new SimulationOption();
            _navService.Navigate(simulationOptions);
        }
    }
}
